home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic 4 Database How-To
/
Visual Basic 4 Database - How-to (The Waite Group)(1995).iso
/
titles.cl_
/
titles.cl
Wrap
Text File
|
1995-07-05
|
1KB
|
52 lines
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "clsTitles"
Attribute VB_Creatable = True
Attribute VB_Exposed = True
Option Explicit
Private m_Coll As New Collection
Private m_Database As String
Property Get Count() As Integer
Count = m_Coll.Count
End Property
Property Let DatabaseName(theDatabase As String)
m_Database = theDatabase
End Property
Property Get DatabaseName() As String
DatabaseName = m_Database
End Property
Public Sub Add(ti As clsTitle)
m_Coll.Add Item:=ti, KEY:=CStr(ti.ISBN)
End Sub
Public Sub Remove(theKey As Long)
m_Coll.Remove CStr(theKey)
End Sub
Public Function Item(theKey As Long) As clsAuthor
Set Item = m_Coll(CStr(theKey))
End Function
Public Sub Clear()
Dim i As Integer
For i = m_Coll.Count To 1 Step -1
m_Coll.Remove i
Next i
End Sub
Public Sub List(ctrl As Variant)
Dim i As Integer
If TypeOf ctrl Is ListBox Or TypeOf ctrl Is ComboBox Then
ctrl.Clear
For i = 1 To m_Coll.Count
If m_Coll(i).Title <> "" Then
ctrl.AddItem m_Coll(i).Title
Else
ctrl.AddItem "<no title>"
End If
ctrl.ItemData(ctrl.NewIndex) = i
Next i
End If
End Sub